package com.leankit.kanban.api.client.library.transferobjects;

import java.util.List;

public class CardView {
    private String SystemType;
    private long Id;
    private long LaneId;
    private String Title;
    private String Description;
    private CardType Type;
    private long TypeId;
    private PriorityType Priority;
    //private String PriorityText { get { return Priority.ToString(); }}
    private String TypeName;
    private String TypeIconPath;
    private String TypeColorHex;
    private int Size;
    private boolean Active;
    private String Color;
    private int Version;
    private List<AssignedUserInfo> AssignedUsers;
    private boolean IsBlocked;
    private String BlockReason;
    private int Index;
    private String DueDate;
    private String ExternalSystemName;
    private String ExternalSystemUrl;
    private String ExternalCardID;
    private String Tags;
    
    public String getPriorityText() {
    	return Priority.toString();
    }
    
    public String getSystemType() {
		return SystemType;
	}
	public void setSystemType(String systemType) {
		SystemType = systemType;
	}
	public long getId() {
		return Id;
	}
	public void setId(long id) {
		Id = id;
	}
	public long getLaneId() {
		return LaneId;
	}
	public void setLaneId(long laneId) {
		LaneId = laneId;
	}
	public String getTitle() {
		return Title;
	}
	public void setTitle(String title) {
		Title = title;
	}
	public String getDescription() {
		return Description;
	}
	public void setDescription(String description) {
		Description = description;
	}
	public CardType getType() {
		return Type;
	}
	public void setType(CardType type) {
		Type = type;
	}
	public long getTypeId() {
		return TypeId;
	}
	public void setTypeId(long typeId) {
		TypeId = typeId;
	}
	public PriorityType getPriority() {
		return Priority;
	}
	public void setPriority(PriorityType priority) {
		Priority = priority;
	}
	public String getTypeName() {
		return TypeName;
	}
	public void setTypeName(String typeName) {
		TypeName = typeName;
	}
	public String getTypeIconPath() {
		return TypeIconPath;
	}
	public void setTypeIconPath(String typeIconPath) {
		TypeIconPath = typeIconPath;
	}
	public String getTypeColorHex() {
		return TypeColorHex;
	}
	public void setTypeColorHex(String typeColorHex) {
		TypeColorHex = typeColorHex;
	}
	public int getSize() {
		return Size;
	}
	public void setSize(int size) {
		Size = size;
	}
	public boolean isActive() {
		return Active;
	}
	public void setActive(boolean active) {
		Active = active;
	}
	public String getColor() {
		return Color;
	}
	public void setColor(String color) {
		Color = color;
	}
	public int getVersion() {
		return Version;
	}
	public void setVersion(int version) {
		Version = version;
	}
	public List<AssignedUserInfo> getAssignedUsers() {
		return AssignedUsers;
	}
	public void setAssignedUsers(List<AssignedUserInfo> assignedUsers) {
		AssignedUsers = assignedUsers;
	}
	public boolean isIsBlocked() {
		return IsBlocked;
	}
	public void setIsBlocked(boolean isBlocked) {
		IsBlocked = isBlocked;
	}
	public String getBlockReason() {
		return BlockReason;
	}
	public void setBlockReason(String blockReason) {
		BlockReason = blockReason;
	}
	public int getIndex() {
		return Index;
	}
	public void setIndex(int index) {
		Index = index;
	}
	public String getDueDate() {
		return DueDate;
	}
	public void setDueDate(String dueDate) {
		DueDate = dueDate;
	}
	public String getExternalSystemName() {
		return ExternalSystemName;
	}
	public void setExternalSystemName(String externalSystemName) {
		ExternalSystemName = externalSystemName;
	}
	public String getExternalSystemUrl() {
		return ExternalSystemUrl;
	}
	public void setExternalSystemUrl(String externalSystemUrl) {
		ExternalSystemUrl = externalSystemUrl;
	}
	public String getExternalCardID() {
		return ExternalCardID;
	}
	public void setExternalCardID(String externalCardID) {
		ExternalCardID = externalCardID;
	}
	public String getTags() {
		return Tags;
	}
	public void setTags(String tags) {
		Tags = tags;
	}
	public Long getClassOfServiceId() {
		return ClassOfServiceId;
	}
	public void setClassOfServiceId(Long classOfServiceId) {
		ClassOfServiceId = classOfServiceId;
	}
	public String getClassOfServiceTitle() {
		return ClassOfServiceTitle;
	}
	public void setClassOfServiceTitle(String classOfServiceTitle) {
		ClassOfServiceTitle = classOfServiceTitle;
	}
	public String getClassOfServiceIconPath() {
		return ClassOfServiceIconPath;
	}
	public void setClassOfServiceIconPath(String classOfServiceIconPath) {
		ClassOfServiceIconPath = classOfServiceIconPath;
	}
	public String getClassOfServiceColorHex() {
		return ClassOfServiceColorHex;
	}
	public void setClassOfServiceColorHex(String classOfServiceColorHex) {
		ClassOfServiceColorHex = classOfServiceColorHex;
	}
	public int getCountOfOldCards() {
		return CountOfOldCards;
	}
	public void setCountOfOldCards(int countOfOldCards) {
		CountOfOldCards = countOfOldCards;
	}
	public List<Comment> getComments() {
		return Comments;
	}
	public void setComments(List<Comment> comments) {
		Comments = comments;
	}
	public List<CardEvent> getHistoryEvents() {
		return HistoryEvents;
	}
	public void setHistoryEvents(List<CardEvent> historyEvents) {
		HistoryEvents = historyEvents;
	}
	private Long ClassOfServiceId;
    private String ClassOfServiceTitle;
    private String ClassOfServiceIconPath;
    private String ClassOfServiceColorHex;
    private int CountOfOldCards;
    private List<Comment> Comments;
    private List<CardEvent> HistoryEvents;

    public Card ToCard()
    {
        Card card = new Card();
        card.Active = this.Active;
        card.ClassOfServiceId = this.ClassOfServiceId;
        card.BlockReason = this.BlockReason;
        card.Description = this.Description;
        card.DueDate = this.DueDate;
        card.ExternalCardID = this.ExternalCardID;
        card.ExternalSystemName = this.ExternalSystemName;
        card.ExternalSystemUrl = this.ExternalSystemUrl;
        card.Id = this.Id;
        card.Index = this.Index;
        card.IsBlocked = this.IsBlocked;
        card.LaneId = this.LaneId;
        
        //TODO: fix
        //card.Priority = (int) this.Priority;
        
        card.Size = this.Size;
        card.Tags = this.Tags;
        card.Title = this.Title;
        card.TypeId = this.TypeId;
        card.Version = this.Version;

        //TODO: fix
        //card.AssignedUserIds =  (this.AssignedUsers!=null) ? this.AssignedUsers.Select(x => x.AssignedUserId).ToArray() : null;

        card.Comments = Comments;
        card.HistoryEvents = HistoryEvents;
        return card;
    }
    
}
